home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 22 / PC Actual CD 22.iso / linux / xfree86 / DOC / README.clkprog < prev    next >
Encoding:
Text File  |  1998-01-07  |  4.1 KB  |  265 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.     Information for using/developing external clock setting programs
  11.  
  12.                The XFree86 Project, Inc.
  13.  
  14.                 16 December 1994
  15.  
  16.  
  17.  
  18. 1.  Using an external clock setting program
  19.  
  20. XFree86 provides a facility for setting the clock frequency on a graphics card
  21. by an external program.  This is provided to make it possible to deal with
  22. cards that use clock selection methods not supported by the standard drivers.
  23.  
  24. This facility is enabled by adding a ClockProg line to the Device section of
  25. the XF86Config file.  The format of this line is:
  26.  
  27.      ClockProg    "commandpath"
  28.  
  29.  
  30. where commandpath is the full pathname of the clock setting program.  No flags
  31. are allowed in commandpath.
  32.  
  33. When using this option, and no Clocks line is specified, it is assumed that the
  34. card has clocks which are fully programmable (like the SS24). However if the
  35. card has a fixed set of preset clocks a Clocks line is required in the Device
  36. section of the XF86Config file to tell the server which clock frequencies are
  37. available to it. The ordering of the clocks in the Clocks line should corre-
  38. spond to what the card/program expects. Up to 128 clock values may be speci-
  39. fied.
  40.  
  41. The server calls the external program when it needs to change the clock fre-
  42. quency.  This occurs at startup and when switching modes with the hot-key
  43. sequences.  The command is passed two command-line arguments.  The first is the
  44. clock frequency in MHz (as a floating point number -- currently specified to
  45. the nearest 0.1 MHz).  The second argument is the index of the clock value in
  46. the Clocks list (the first clock is index 0).  Cards with a fixed set of clocks
  47. would probably make use of the index, while cards with a fully programmable
  48. clock would use the frequency argument.
  49.  
  50.  
  51. 2.  Developing an extern clock setting program
  52.  
  53. When such an external program is being used, the server does not change any
  54. register fields related to clock selection, and the external program must be
  55. careful to only modify clock selection fields.    The program is run with stdin
  56. and stdout set to xf86Info.consoleFd -- which is the fd to use for display-
  57. related ioctl() operations if required.  Stderr is the same as the server's
  58. stderr -- so error or warning messages should be directed there.  The program
  59. is run with the uid set to the real user's ID -- so if it needs to use privi-
  60. leged system calls it should be suid-root.  The program does not inherit any
  61. I/O access privileges, so it will need to do whatever is required to enable
  62.  
  63.  
  64.  Information for using/developing external clock setting programs
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  Information for using/developing external clock setting programs
  71.  
  72.  
  73.  
  74. them.
  75.  
  76. The program is expected to return an exit status 0 when successful, and a sta-
  77. tus in the range 1-254 when it fails.  If the external program fails during the
  78. server initialisation stage, the server exits.    If it fails for a mode switch,
  79. the mode switch is aborted (the server assumes that the clock frequency hasn't
  80. been changed) and the server keeps running.  If necessary an exit status may be
  81. specified in the future for which the server would exit if the program fails
  82. for a mode switch.
  83.  
  84. A sample clock switching program is provided for use with many ET4000 cards
  85. that have a fixed set of 8 clocks.  This program is only intended as a sample,
  86. and it is not intended for general use (the internal server code handles this
  87. type of card).    The program is xc/programs/Xserver/hw/xfree86/etc/et4000clock.c
  88. in the source tree, and /usr/X11R6/lib/X11/etc/et4000clock.c in the binary
  89. tree.
  90.  
  91. The idea of using an external clock program was suggested by Frank Klemm
  92. <pfk@rz.uni-jena.de>
  93.  
  94.      Generated from XFree86: xc/programs/Xserver/hw/xfree86/doc/sgml/clkprog.sgml,v 3.7 1997/01/24 09:32:48 dawes Exp $
  95.  
  96.  
  97.  
  98.  
  99.  
  100.      $XConsortium: clkprog.sgml /main/3 1996/02/21 17:46:48 kaleb $
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  Information for using/developing external clock setting programs
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.                    CONTENTS
  207.  
  208.  
  209.  
  210. 1. Using an external clock setting program  ................................. 1
  211.  
  212. 2. Developing an extern clock setting program  .............................. 1
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                        i
  263.  
  264.  
  265.